package com.heima.article.controller;

import com.heima.article.service.BehaviorArticleService;
import com.heima.model.common.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.UserRelationDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户文章操作接口
 */
@RestController
@RequestMapping("/api/v1")
public class BehaviorArticleController {

    @Autowired
    private BehaviorArticleService behaviorArticleService;

    /**
     * 用户收藏文章
     * @param dto
     */
    @PostMapping("/collection_behavior")
    public ResponseResult collectionBehavior(@RequestBody CollectionBehaviorDto dto){

        return behaviorArticleService.collectionBehavior(dto);
    }

    /**
     * 加载文章行为
     * @param dto
     */
    @PostMapping("/article/load_article_behavior")
    public ResponseResult loadArticleBehavior(@RequestBody UserRelationDto dto){

        return behaviorArticleService.loadArticleBehavior(dto);
    }


}
